package com.example.heathy_me.utils;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.example.heathy_me.homeDetail.Medicine;

public class RingReceiver extends BroadcastReceiver {


    @Override
    public void onReceive(Context context, Intent intent1) {
        if("com.example.android28_alarm_notification.RING".equals(intent1.getAction())){
            Log.i("test","收到广播了");
            Intent intent=new Intent(context, Medicine.class);
            //广播跳activity必须设置标志位
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//新的栈
            context.startActivity(intent);
        }
    }
}
